<template>
  <div style="margin-top: 100px; margin-left: 100px">
    <input ref="inputRef" />
    <p>
      <span>count is {{ count }}</span>
      <button @click="count++">+1</button>
    </p>
    <p>
      <button @click="force">强制更新</button>
    </p>
  </div>
</template>

<script lang="ts" setup>
import { ref, nextTick, onUpdated } from 'vue'
const inputRef = ref()

const count = ref(0)

// onMounted(() => {
//   inputRef.value.focus()
// })

nextTick(() => {
  inputRef.value.focus()
})

onUpdated(() => {
  console.log('---onUpdated---')
})

const force = () => {}
</script>
